package com.wwtech.epp.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by hu on 2017/9/3.
 */

public class User implements Parcelable{


    /**
     * userId : 10014
     * nickName : hdj
     * gender : false
     * avatar : http://s3.cn-north-1.amazonaws.com.cn/zxltest/20170904/932d179ad6e146f48eba37a492b32e21.png
     * phone : 13700000001
     * department : null
     * orgTitle : 公司职员
     * email : xnby@vv-tech.com
     */

    private int userId;
    private String nickName;
    private boolean gender;
    private String avatar;
    private String phone;
    private String department;
    private String orgTitle;
    private String email;
    private int workStatus;
    private int orgId;
    private int roleLevel;

    public int getOrgId() {
        return orgId;
    }

    public void setOrgId(int orgId) {
        this.orgId = orgId;
    }

    public int getRoleLevel() {
        return roleLevel;
    }

    public void setRoleLevel(int roleLevel) {
        this.roleLevel = roleLevel;
    }

    protected User(Parcel in) {
        userId = in.readInt();
        nickName = in.readString();
        gender = in.readByte() != 0;
        avatar = in.readString();
        phone = in.readString();
        orgTitle = in.readString();
        email = in.readString();
        workStatus = in.readInt();
        orgId = in.readInt();
        roleLevel = in.readInt();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public boolean isGender() {
        return gender;
    }

    public void setGender(boolean gender) {
        this.gender = gender;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public int getWorkStatus() {
        return workStatus;
    }

    public void setWorkStatus(int workStatus) {
        this.workStatus = workStatus;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getOrgTitle() {
        return orgTitle;
    }

    public void setOrgTitle(String orgTitle) {
        this.orgTitle = orgTitle;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(userId);
        dest.writeString(nickName);
        dest.writeByte((byte) (gender ? 1 : 0));
        dest.writeString(avatar);
        dest.writeString(phone);
        dest.writeString(orgTitle);
        dest.writeString(email);
        dest.writeInt(workStatus);
        dest.writeInt(orgId);
        dest.writeInt(roleLevel);
    }
}
